#!/usr/bin/env python
# -*- coding: UTF-8 -*-

class cat:
        suma        = 0
        producto    = 1
        entero      = 2
        abre        = 3
        cierra      = 4
        nl          = 5
        eof         = 6
        
class componente:
    catstr = ["suma", "producto", "entero", "abre", "cierra", "nl", "eof"]
    
    def __init__(self, cat, linea, caracter):
        self.cat = cat
        self.linea = linea
        self.caracter = caracter
        
    def __str__(self):
        s = "[%s" % componente.catstr[self.cat]
        for atr, val in self.__dict__.items():
            if atr != "cat":
                s = s + " %s=%s" % (atr, val)
        return s + "]"
    
    def getcaracter(self):
        return self.caracter
    
class suma(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.suma, linea, caracter)
        
class producto(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.producto, linea, caracter)
        
class entero(componente):
    def __init__(self, valor, linea, caracter):
        componente.__init__(self, cat.entero, linea, caracter)
        self.valor = valor
        
class abre(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.abre, linea, caracter)
        
class cierra(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.cierra, linea, caracter)
        
class nl(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.nl, linea, caracter)
        
class eof(componente):
    def __init__(self, linea, caracter):
        componente.__init__(self, cat.eof, linea, caracter)
        